package com.lm.basic;

import lombok.Data;

import javax.servlet.Servlet;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public class Context {
    private String appname;
    private Map<String, Class<Servlet>> UrlPatternMapping= new ConcurrentHashMap<>();

    public Context(String appname) {
        this.appname = appname;
    }

    public void addUrlPattern(String url,Class<Servlet> clazz){
        UrlPatternMapping.put(url,clazz);
    }

    public Class<Servlet> getUrlPattern(String url){
        return UrlPatternMapping.get(url);
    }

    public String getAppname() {
        return appname;
    }
}
